var mapPanel = new Ext.Panel({
    fullscreen: true,
    items     : [{
        xtype             : 'map',
        useCurrentLocation: true
    }]
});

var mapList = new Ext.NestedList({
    fullscreen: true,
    //title: 'Favorites',
    id:'mapListPanel',
    //displayField: 'text',
    store: favStore,
    getDetailCard: function(item, parent) {
        //console.log(item.attributes.record.data);
        //console.log(parent)
        //return;
        var itemData = item.attributes.record.data,
        //parentData = parent.attributes.record.data,
        detailCard = new Ext.Panel({
            scroll: 'vertical',
            styleHtmlContent: true,
            tpl: ["<h2>{text}</h2>","{date}","{content}"]
        });
        detailCard.update(itemData);
        this.backButton.setText(itemData.text);
        return detailCard;
    },
    getItemTextTpl:function(){
        var tplConstructor = '{text}' +
            '<tpl for=".">'+
                '<div class="metadata">' +
                    ' {date}' +
                '</div>' +
            '</tpl>';
        return tplConstructor;
    }
});






addMarker = function(lanLung) {
    //var latLng = new google.maps.LatLng(lanLung.lan, tweet.geo.coordinates[1]);

    var marker = new google.maps.Marker({
        map: mapPanel.map,
        position: latLng
    });

    google.maps.event.addListener(marker, "click", function() {
        tweetBubble.setContent(tweet.text);
        tweetBubble.open(mapPanel.map, marker);
    });
};

//Nearby
DC.views.nearby = Ext.extend(Ext.Panel,{
    title:'Nearby',
    iconCls:'nearby_dc',
    layout:'card',
    dockedItems:[{
        xtype:'toolbar',
        title:'Nearby',
        layout:'hbox',
        flex:1,
        items:[
            new Ext.Button({
                ui  : 'round',
                text: 'map',
                id:'btn-map',
                handler:function(){
                    
                }
            }),
            {
                ui  : 'round',
                text: 'list',
                id:'btn-list',
                handler:function(){
                    
                }
            }
        ]
    }],
    items:[mapList, mapPanel]
    /*dockedItems:{
     xtype:'toolbar',
     title:'Nearby'
     }*/
});
Ext.reg('nearby', DC.views.nearby);